var express = require('express');
var router = express.Router();
var {adminDao,
  logDao,
  playerDao,
  raidDao,
  save
} = require('../data')

router.get('/', function(req, res, next) {
  res.status(404);
  res.end();
});

//raid列表
router.post('/list',function(req,res,next){
  raidDao.search({
    ...req.body
  }).then(({data})=>{
    res.json({
      status: 0,
      data
    })
  })
});

router.post('/detail',function(req,res,next){
  raidDao.detail(req.body.key).then(({data:raid})=>{
    raidDao.info(raid.source).then(({data})=>{
      res.json({
        status: 0,
        data:{
          raid: raid,
          source: data
        }
      })      
    })
  })
});

module.exports = router;